import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:stock_check/common/utils/CommonUtils.dart';

// ignore: must_be_immutable
class ShowFullImage extends Dialog {
  String base64;

  ShowFullImage({Key key, @required this.base64}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return new Material( //创建透明层
      type: MaterialType.transparency, //透明类型
      child: new Center( //保证控件居中效果
        child: new SizedBox(
          width: CommonUtils.getScreenWidth(context)-50,
          height: CommonUtils.getScreenHeight(context)-50,
          child: new Container(
            child: GestureDetector(
              child: Image.memory(
                Base64Decoder().convert(base64),
                fit:BoxFit.contain,
              ),
              onTap: (){
                Navigator.pop(context);
              },
            )
          ),
        ),
      ),
    );
  }
}